// 图表类型常量
export const DIAGRAM_TYPES = {
  CLASS: 'class',
  ACTIVITY: 'activity',
  SEQUENCE: 'sequence',
  USECASE: 'usecase',
  STATE: 'state'
}

// 元素类型常量
export const ELEMENT_TYPES = {
  CLASS: 'class',
  INTERFACE: 'interface',
  ENUM: 'enum',
  ACTIVITY: 'activity',
  LIFELINE: 'lifeline',
  USECASE: 'usecase',
  STATE: 'state',
  RELATIONSHIP: 'relationship',
  PACKAGE: 'package',      // 新增：包
  NAMESPACE: 'namespace',  // 新增：命名空间
  NOTE: 'note'             // 新增：注释
}

// 活动类型常量
export const ACTIVITY_TYPES = {
  START: 'start',
  END: 'end',
  ACTION: 'action',
  DECISION: 'decision',
  MERGE: 'merge',
  FORK: 'fork',
  JOIN: 'join',
  REPEAT: 'repeat',
  BREAK: 'break',
  SWITCH: 'switch',
  CASE: 'case',
  ENDSWITCH: 'endswitch',
  CONDITION: 'condition',
  ELSE: 'else',
  ENDIF: 'endif',
  WHILE: 'while',
  ENDWHILE: 'endwhile',
  NOTE: 'note',
  PARTITION: 'partition',
  DETACH: 'detach',        // 新增：无连接线继续
  KILL: 'kill'             // 新增：终止流程分支
}

// 参与者类型常量
export const PARTICIPANT_TYPES = {
  ACTOR: 'actor',
  PARTICIPANT: 'participant',
  BOUNDARY: 'boundary',
  CONTROL: 'control',
  ENTITY: 'entity',
  DATABASE: 'database',
  COLLECTIONS: 'collections',  // 新增：集合
  QUEUE: 'queue'               // 新增：队列
}

// 用例类型常量
export const USECASE_TYPES = {
  ACTOR: 'actor',
  USECASE: 'usecase',
  SYSTEM: 'system',
  RECTANGLE: 'rectangle',  // 新增：矩形
  CLOUD: 'cloud',          // 新增：云
  PACKAGE: 'package'       // 新增：包
}

// 状态类型常量
export const STATE_TYPES = {
  INITIAL: 'initial',
  FINAL: 'final',
  STATE: 'state',
  COMPOSITE: 'composite',
  CHOICE: 'choice',        // 新增：选择
  FORK: 'fork',            // 新增：分叉
  JOIN: 'join',            // 新增：合并
  HISTORY: 'history',      // 新增：历史状态
  DEEP_HISTORY: 'deepHistory', // 新增：深度历史状态
  ENTRY: 'entry',          // 新增：入口活动
  EXIT: 'exit',            // 新增：出口活动
  DO: 'do'                 // 新增：执行活动
}

// 关系类型常量
export const RELATIONSHIP_TYPES = {
  ASSOCIATION: 'association',
  INHERITANCE: 'inheritance',
  IMPLEMENTATION: 'implementation',
  COMPOSITION: 'composition',
  AGGREGATION: 'aggregation',
  DEPENDENCY: 'dependency',
  REALIZATION: 'realization',
  BIDIRECTIONAL: 'bidirectional',  // 新增：双向关联
  REFLEXIVE: 'reflexive',          // 新增：自反关联
  NARY: 'nary',                    // 新增：多重关联
  LINK: 'link',                    // 新增：通用链接
  ASYNC: 'async',                  // 新增：异步消息
  CREATE: 'create',                // 新增：创建消息
  DESTROY: 'destroy'               // 新增：销毁消息
}

// 可见性类型常量
export const VISIBILITY_TYPES = {
  PUBLIC: 'public',
  PRIVATE: 'private',
  PROTECTED: 'protected',
  PACKAGE: 'package'       // 新增：包可见性
}

// 颜色映射
export const COLOR_MAP = {
  'lightblue': '#87CEEB',
  'lightgreen': '#90EE90',
  'pink': '#FFC0CB',
  'lightyellow': '#FFFFE0',
  'lightgray': '#D3D3D3',
  'red': '#FF0000',
  'green': '#00FF00',
  'blue': '#0000FF',
  'yellow': '#FFFF00',
  'orange': '#FFA500',
  'purple': '#800080',
  'black': '#000000',
  'white': '#FFFFFF'
}

// 参与者颜色配置
export const PARTICIPANT_COLORS = {
  actor: {
    gradient: ['#ff7f50', '#ff6347'],
    stroke: '#d2691e',
    icon: '#ffffff'
  },
  database: {
    gradient: ['#4169e1', '#1e90ff'],
    stroke: '#000080',
    icon: '#ffffff'
  },
  boundary: {
    gradient: ['#32cd32', '#228b22'],
    stroke: '#006400',
    icon: '#ffffff'
  },
  control: {
    gradient: ['#ffd700', '#ffa500'],
    stroke: '#daa520',
    icon: '#000000'
  },
  entity: {
    gradient: ['#9370db', '#8a2be2'],
    stroke: '#4b0082',
    icon: '#ffffff'
  },
  collections: {
    gradient: ['#20b2aa', '#008b8b'],
    stroke: '#006666',
    icon: '#ffffff'
  },
  queue: {
    gradient: ['#da70d6', '#9932cc'],
    stroke: '#8b008b',
    icon: '#ffffff'
  },
  default: {
    gradient: ['#ffffff', '#f5f5f5'],
    stroke: '#d9d9d9',
    icon: '#333333'
  }
}

// 元素尺寸配置
export const ELEMENT_SIZES = {
  activity: { width: 100, height: 100 },
  lifeline: { width: 80, height: 120 },
  usecase: { width: 120, height: 80 },
  state: { width: 100, height: 60 },
  package: { width: 180, height: 120 },
  note: { width: 120, height: 60 },
  default: { width: 150, height: 100 }
}

// 画布配置
export const CANVAS_CONFIG = {
  GRID_SIZE: 20,
  CONNECTION_POINT_RADIUS: 6,
  SELECTION_PADDING: 8,
  LIFELINE_LENGTH: 200,
  SHADOW_BLUR: 8,
  SHADOW_OFFSET: 2
}

// 新增：关系样式配置
export const RELATIONSHIP_STYLES = {
  SOLID: 'solid',
  DASHED: 'dashed',
  DOTTED: 'dotted',
  BOLD: 'bold',
  HIDDEN: 'hidden'
}

// 新增：箭头样式配置
export const ARROW_STYLES = {
  NONE: 'none',
  NORMAL: 'normal',
  OPEN: 'open',
  FILLED: 'filled',
  DIAMOND: 'diamond',
  CIRCLE: 'circle'
}

// 新增：注释位置配置
export const NOTE_POSITIONS = {
  LEFT: 'left',
  RIGHT: 'right',
  TOP: 'top',
  BOTTOM: 'bottom'
}

// 新增：生命线激活状态
export const LIFELINE_ACTIVATIONS = {
  NONE: 'none',
  ACTIVE: 'active',
  NESTED: 'nested',
  SELF: 'self'
}

// 新增：类图构造器类型
export const CONSTRUCTOR_TYPES = {
  DEFAULT: 'default',
  COPY: 'copy',
  MOVE: 'move',
  CONVERSION: 'conversion',
  TEMPLATE: 'template'
}

// 新增：类图方法修饰符
export const METHOD_MODIFIERS = {
  STATIC: 'static',
  ABSTRACT: 'abstract',
  FINAL: 'final',
  SYNCHRONIZED: 'synchronized',
  VIRTUAL: 'virtual',
  OVERRIDE: 'override'
}

// 新增：类图属性修饰符
export const ATTRIBUTE_MODIFIERS = {
  STATIC: 'static',
  READONLY: 'readonly',
  CONST: 'const',
  VOLATILE: 'volatile',
  TRANSIENT: 'transient'
}

// 新增：时序图消息类型
export const MESSAGE_TYPES = {
  SYNC: 'sync',
  ASYNC: 'async',
  REPLY: 'reply',
  CREATE: 'create',
  DESTROY: 'destroy',
  SELF: 'self',
  FOUND: 'found',
  LOST: 'lost'
}